/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.starter.iam.authentication.local.config;

import com.snail.starter.iam.authentication.jwt.JwtService;
import com.snail.starter.iam.authentication.local.LocalAuthentication;
import com.snail.starter.iam.authentication.local.token.memory.MemoryTokenService;
import com.snail.starter.iam.authentication.local.token.redis.RedisTokenService;
import com.snail.starter.iam.authentication.local.user.service.LocalUserService;
import com.snail.starter.utils.annotation.Cluster;
import com.snail.starter.utils.annotation.Local;
import com.snail.starter.utils.annotation.StandAlone;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author zgadmin
 * @date 2025/8/27 10:04
 */
@Local
@Configuration
@Import({JwtService.class, LocalUserService.class, LocalAuthentication.class})
public class LocalAuthenticationAutoConfiguration {

    @Bean
    JwtService jwtService() {
        return new JwtService();
    }

    @Bean
    @StandAlone
    MemoryTokenService memoryTokenService() {
        return new MemoryTokenService();
    }

    @Bean
    @Cluster
    RedisTokenService redisTokenService() {
        return new RedisTokenService();
    }

}